<?php 
header("Content-type: text/html; charset=utf-8");


include '../c/config.php';
$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}
$sql="SELECT * FROM `uinfo` WHERE `idcard` LIKE '%,%' ORDER BY `id` ASC";
$query=$mysqli->query($sql);
while ($list=$query->fetch_assoc()){
     $id=$list['id'];
     $name=$list['name'];
     var_dump($list);
     echo '<br />';
     $file = fopen('z.csv','r');
     while ($data = fgetcsv($file)) { //每次读取CSV里面的一行内容
         $data = eval('return '.iconv('gbk','utf-8',var_export($data,true)).';');
         print_r($data);
         if ($data[3] == $name && $data[2] == $list['nianji']){
             echo 'id:';
             echo $data[4];
             
             $sql="update uinfo set idcard='".$data[4]."' WHERE id='".$list['id']."'  ";
             $mysqli->query($sql);
             
             $sql="update uinfo_sim set idcard='".$data[4]."' WHERE id='".$list['id']."'  ";
             $mysqli->query($sql);
             
             
             echo '
<script>
window.setTimeout(function(){
window.location.reload();
}, 1000);


</script>

';
             
             exit;
         }
         
         
         echo "<br />";
     }
    
    
    exit;
}


exit;
$file = fopen('j.csv','r');
while ($data = fgetcsv($file)) { //每次读取CSV里面的一行内容
    $data = eval('return '.iconv('gbk','utf-8',var_export($data,true)).';');
    print_r($data);
    if ($data[3] == '项奕博'){
        exit;
    }
    
    
  echo "<br />";
}